dict_word = {'教师': 'tutor', '前进': 'forward',
             '后退': 'backward', '右转': 'right',
             '左转': 'left', '海龟': 'turtle'}

flag = False
while True:
    isPractice = input('是否需要练习? 输入n/y(不分大小写)')
    if isPractice == 'n' and isPractice == 'N' and \
            isPractice == 'y' and isPractice == 'Y':
        continue
    else:
        if isPractice == 'n' or isPractice == 'N':
            print('over')
            break
        else:
            print('考试开始')
            flag = True
            break

test = dict_word.copy()
count = 0
if not flag:
    pass
else:
    lst_test = list(test.keys())
    for i in lst_test:
        answer = test[i]
        result = input(i + ' 翻译成英文是: ')
        if answer == result:
            pass
        else:
            count += 1
    print('考试结束')
    print('答对: ' + str(6 - count) + ', ' + '答错: ' +
          str(count) + ', ' + '正确率: ' +
          str(6 - count / 6))
